package com.own.business.push.persistence.mysql.service;

import com.own.business.push.persistence.mysql.entity.bo.PushRegistrationBo;
import com.own.business.push.persistence.mysql.entity.map.PushRegistrationMapVo;
import com.own.business.push.persistence.mysql.entity.po.PushRegistration;
import com.own.business.push.persistence.mysql.entity.query.PushRegistrationQuery;
import com.own.business.push.persistence.mysql.entity.vo.PushRegistrationVo;
import com.own.component.common.base.service.BaseService;

import java.util.Collection;
import java.util.List;

/**
 * PushRegistrationService
 *
 * @author chenxueli
 * @date 2023-11-16 14:14:41
 */
public interface PushRegistrationService extends BaseService<
        PushRegistration,
        PushRegistrationBo,
        PushRegistrationVo,
        PushRegistrationMapVo,
        PushRegistrationQuery
        > {

    /**
     * 根据用户id删除
     *
     * @param userId 用户id
     */
    void deleteByUserId(Long userId);

    /**
     * 根据regId和module删除
     *
     * @param regId  注册id
     * @param module 模块
     */
    void deleteByRegId(String regId, String module);

    /**
     * 保存信息
     *
     * @param userId 用户id
     * @param regId  注册id
     * @param module 模块
     */
    void save(Long userId, String regId, String module);

    /**
     * 根据用户id获取
     *
     * @param userId 用户id
     * @return 推送注册
     */
    PushRegistration getByUserId(Long userId);

    /**
     * 根据用户ids获取
     *
     * @param userIdList 用户ids
     * @return 推送注册
     */
    List<PushRegistration> listByUserIdList(Collection<Long> userIdList);

    /**
     * 根据模块查询注册id列表
     *
     * @param module 模块
     * @return 注册id列表
     */
    List<String> listRegIdListByModule(String module);

}

